package com.chunxiadong.service;

import com.chunxiadong.entity.Blog;
import com.chunxiadong.entity.BlogBySearch;
import com.chunxiadong.entity.RecommendBlog;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @auther QiuShangcheng
 * @create 2021/6/7
 */
public interface BlogService {
    int addBlog(Blog blog);

    List<Blog> getAllBlog();

    List<Blog> getAllBlogToArchive();

    List<Blog> getAllBlogToAdmin();

    Blog getBlog(Integer id);

    int updateBlog(Blog blog);

    Blog getBlogToUpdate(Integer id);

    int deleteBlogById(Integer id);

    int IncreaseViews(Integer id);

    List<RecommendBlog> getRecommendBlog(RecommendBlog blog);

    List<Blog> getBlogByTypeAndTitle(BlogBySearch blog);

    PageInfo<Blog> getAllBlogByPage(Integer page, Integer rows);

    PageInfo<Blog> getAllBlogToAdminByPage(Integer page, Integer rows);

    PageInfo<Blog> getSearchBlogByPage(Integer page, Integer rows,BlogBySearch blog);
}
